package org.minos.edit.controller
{
	import flash.events.Event;
	import flash.filesystem.File;
	import org.ichow.debug.Debug;
	import org.minos.edit.model.AssetsProxy;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author M.ichow
	 */
	public class SelectPathCommand extends SimpleCommand
	{
		
		override public function execute( notification : INotification ) : void
		{
			super.execute( notification );
			
			var file : File = new File( "file:///E:/work/%e6%83%85%e5%a2%83%e6%95%99%e5%ad%a6/SceneCourseWare/bin" );
			file.addEventListener( Event.SELECT , onSelect );
			file.browseForDirectory( "选择目录" );
			
			function onSelect( e : Event ) : void
			{
				Debug.log( file.url , this );
				notification.getBody()[ "text" ] = file.url;
				file.removeEventListener( Event.SELECT , onSelect );
				AssetsProxy( facade.retrieveProxy( AssetsProxy.NAME ) ).getAssets( file.url );
				file = null;
			}
		
		}
	
	}

}